package com.hqyj.dao;

import com.hqyj.pojo.TbCommunity;
import com.hqyj.pojo.TbOwner;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 业主表 Mapper 接口
 * </p>
 *
 * @author gp
 * @since 2021-09-26
 */
@Repository
public interface TbOwnerMapper extends BaseMapper<TbOwner> {

    @Select("select * from tb_community where id = #{communityId}")
    TbCommunity getByCommunityId(int communityId);

    @Select("select id,community_id,house_id,name,picture,idcard,telephone,email,profession,sex,type,remark,birthday" +
            " from tb_owner where id = #{id}")
    TbOwner findById(int id);

    @Select("select * from tb_owner where login_name = #{loginName} and password = #{password}")
    TbOwner login(TbOwner tbOwner);
}
